package com.itheima.threadpool;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadDemo {
    public static void main(String[] args) {
        //获取线程池对象
        ExecutorService pools = Executors.newCachedThreadPool();

        //提交任务
        pools.submit(new MyRunnable());
        pools.submit(new MyRunnable());
        pools.submit(new MyRunnable());
        pools.submit(new MyRunnable());
        pools.submit(new MyRunnable());


        //销毁线程池
        //pools.shutdown();
    }
}
